<template>
  <div>
    <h1>page-day1----插值语法----指令</h1>
    <hr />
    <h2>插值语法</h2>
    <p v-if="isShow">{{ message }}--{{ count }}--{{ isShow }}</p>
    <button @click="countAdd(3)">+3</button>
    <button @click="toggle()">切换显示</button>
    <hr />
    <h2>指令--(v-once)</h2>
    <p>{{ count }}---可变</p>
    <p v-once>{{ count }}---不可变</p>
    <button @click="countAdd(3)">+3</button>
    <hr />
    <h2>(v-test)</h2>
    <p>{{ message }}</p>
    <p v-text="message"></p>
    <hr />
    <h2>(v-clock)</h2>
    <div v-cloak>{{ message }}</div>
  </div>
</template>

<script>
export default {
  name: 'page-day1',
  data() {
    return {
      message: 'hello world!',
      count: 1000,
      isShow: true
    }
  },
  methods: {
    countAdd(n) {
      this.count += n
    },
    toggle() {
      this.isShow = !this.isShow
      console.log(this.isShow)
    }
  }
}
</script>

<style lang="scss" scoped>
[v-cloak] {
  display: none;
}
</style>
